import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Descrpition:
 * User: 86183
 * Date: 2022-11-10
 * Time: 9:47
 */
public class Test {

    public static void main(String[] args) {
        HashMap<String,Integer> map = new HashMap<>();
        map.put("张三",1);
        map.put("李四",5);
        System.out.println(map);
    }
    public static void main2(String[] args) {
        TreeSet<String> set = new TreeSet<>();
        set.add("hello");
        set.add("abc");
        set.add("xser");
        System.out.println(set);

    }
    public static void main1(String[] args) {
       TreeMap<String,Integer> map = new TreeMap<>();
        map.put("hello",3);
        map.put("abc",4);
        map.put("大飞",12);
        map.put("武松",34);
//        System.out.println(map.get("hello"));
       map.remove("hello");
//        Set<String> set = map.keySet();
        Collection<Integer> s = map.values();
        System.out.println(s);
        Set<Map.Entry<String, Integer>> entrySet = map.entrySet();
        for (Map.Entry<String, Integer> entry: entrySet) {
            System.out.println("key: "+entry.getKey()+ " val:"+ entry.getValue());

        }
//        System.out.println(set);
        System.out.println(map);
    }
}
